package com.djx.controller;

import com.alibaba.fastjson.JSON;
import com.djx.config.AliSmsConfiguration;
import com.djx.utils.SmsUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName: SendController
 * @Description: TODO
 * @author: 星~
 * @date: 2021/9/28 0028 下午 15:20
 */
@RestController
@RequestMapping("/send")
public class SendController {

    @Autowired
    AliSmsConfiguration smsConfiguration;

    @RequestMapping("/sendMsg")
    public Map sendMsg(String phone, String code) {
        return SmsUtils.sendTheVerificationCode(phone, code, smsConfiguration);
    }



    @RequestMapping("test/configuration")
    public void cc() {
        System.out.println(smsConfiguration.getAccessKeyId());
        System.out.println(smsConfiguration.getAccessKeySecret());
    }
}
